<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" type="text/css" href="gpfw_layout.css" media="all"/>
<link rel="stylesheet" type="text/css" href="gpfw_color.css" media="all">
<link rel="stylesheet" type="text/css" href="gpfw_font-size_medium.css" media="all"/>
<link rel="stylesheet" type="text/css" href="gpfw_print.css" media="print"/>
<script type="text/javascript" src="gpfw.js"></script>
<script type="text/javascript" src="js/jquery-1.4.4.js" charset="utf-8"></script>
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>
  </head>
  
  <body>
 <table class="azmainFrame" cellspacing="0" cellpadding="0">
  <tr>
    <td class="azgyom"><table class="azpalette" cellpadding="0" cellspacing="0">
  <tr>
    <td class="azpalette"><table class="aztileLarge" cellspacing="0" cellpadding="0">
  <tr>
    <td><ragSUBMIT1" cellpadding="0" cellspacing="0" style="display:inline-table;">
  
  
    
    <title>切换城市</title>
    <script type="text/javascript" src="<%=path%>/commonjs/jquery-1.7.1.js"></script>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
		<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  <body>
    <table style="border: 1px solid;">
    	<thead>切换城市(城市列表)</thead>
    	<tbody id="change_city_to" style="border: 1px solid;">
    	</tbody>
    </table>
    <form action="<%=path%>/changeCurrentCity.action" method="post" id="change_city_form">
    	<input type="hidden" name="cityId" value="" id="cityId">
    </form>
    <script type="text/javascript">
    	$.post('<%=path%>/json/acquireAllProvinceCity.action',
    		{},
    		function(data){
    			for(var i=0;i<data.provinceCitys.length;i++){
    				var result='<tr><td>'+data.provinceCitys[i].provinceName+"&nbsp;&nbsp;&nbsp;</td><td>";
    				for(var j=0;j<data.provinceCitys[i].citys.length;j++){
    					result=result+'<input type="button" onclick="setCity('+data.provinceCitys[i].citys[j].id+');" value="'+data.provinceCitys[i].citys[j].name+'"/>&nbsp;&nbsp;';
    				}
    				result=result+'</td></tr>';
    				$(result).appendTo("#change_city_to");
    			}
    		},
    		'json');
    	function setCity(cityId){
	    	$("#cityId").val(cityId);
	    	$("#change_city_form").submit();
    	}
    </script>
  </body>
</html>
